<template>
	<view class="details">
		<!-- 顶部 -->
		<view class="">
			<view class="site-content-first">
				<view class="site-content-first-img">
					<image :src="img" mode="" class="son" />
				</view>
				<view class="site-content-first-top">{{name}}</view>
				<view class="site-content-first-bottom">{{published_at}}</view>
				<view class="site-content-first-bottomX" @click="collect" v-if="fiag">
					立即收藏
				</view>
				<view class="site-content-first-bottomX" v-else>
					已收藏
				</view>
			</view>
			<view class="person-desc">
				<view class="person-desc-title">
					个人介绍
				</view>
				<view class="person-desc-content">
					{{details}}
				</view>
			</view>
			<view class="getPhone">
				立即联系
			</view>
		</view>
	</view>

</template>

<script>
	import {
		mapMutations
	} from 'vuex'
	export default {
		data() {
			return {
				talentslist: [],
				name: '',
				details: '',
				published_at: '',
				img: '',
				fiag: true
			}
		},
		onLoad(event) {
			var str = JSON.parse(event.detailDate);
			this.name = str.author_name,
				this.details = str.details,
				this.published_at = str.published_at,
				this.img = str.cover
			console.log(JSON.parse(event.detailDate));

			this.banner = JSON.parse(event.detailDate);
			//详情标题
			uni.setNavigationBarTitle({
				title: this.banner.title,
			});
		},
		methods: {
			...mapMutations(['collects']),
			collect() {
				var name = this.name;
				var details = this.details;
				var publishedat = this.published_at;
				var img = this.img;
				this.fiag = false
				this.collects({
					name,
					details,
					publishedat,
					img
				})

			}
		},
	}
</script>

<style scoped lang="less">
	.site-content-first-bottomX {
		position: absolute;
		bottom: 72px;
		right: 31px;
		width: 100px;
		text-align: center;
		height: 30px;
		border: 1px solid #000000;
	}

	// 顶部样式
	.top {
		width: 375px;
		height: 47px;
		display: flex;
		background-color: #fff;

		.back {
			float: left;
			width: 63px;
			height: 47px;
			left: 0px;
			top: 20px;
			line-height: 47px;
			font-size: 30px;
			background-color: rgba(255, 255, 255, 1);
			text-align: center;
			border: 1px solid rgba(187, 187, 187, 1);
		}

		.top-title {
			float: left;
			width: 240px;
			height: 49px;
			line-height: 49px;
			text-align: center;
			font-size: 23px;

		}
	}

	// 人才样式
	.site-content-first {
		background-color: #fff;
		border-bottom: 1px solid #999999;
		position: relative;
		display: flex;
		width: 375px;
		height: 138px;

		.site-content-first-img {
			position: absolute;
			margin-left: 11px;
			margin-top: 13px;
			width: 100px;
			height: 113px;
			border-radius: 6px;
			// background-color: #0044CC;
			background-color: green;

			.son {
				width: 100px;
				height: 113px;
			}
		}

		.site-content-first-top {
			position: absolute;
			margin-top: 22px;
			margin-left: 127px;
			width: 200px;
			height: 40px;
			line-height: 20px;
			color: rgba(16, 16, 16, 1);
			font-size: 18px;
			text-align: left;
			font-family: Arial;
		}

		.site-content-first-mid {
			position: absolute;
			margin-top: 50px;
			margin-left: 118px;
			width: 100px;
			height: 23px;
			line-height: 17px;
			color: rgba(153, 153, 153, 1);
			font-size: 12px;
			text-align: center;
			font-family: Arial;
		}

		.talents-content-desc {
			position: absolute;
			margin-top: 103px;
			margin-left: 127px;
			// width:300px;
			color: rgba(153, 153, 153, 1);
			height: 23px;
			line-height: 23px;
			font-size: 16px;
			font-family: Arial;
		}

		.site-content-first-bottom {
			position: absolute;
			margin-top: 83px;
			margin-left: 127px;
			width: 72px;
			height: 23px;
			line-height: 20px;
			color: rgba(255, 68, 68, 1);
			font-size: 14px;
			text-align: center;
			font-family: Arial;
		}
	}

	// 个人介绍样式
	.person-desc {
		margin-top: 10px;
		width: 375px;
		height: 138px;
		background-color: #fff;
		text-align: left;

		.person-desc-title {
			margin-left: 10px;
			width: 375px;
			height: 49px;
			line-height: 49px;
			font-size: 20px;
		}

		.person-desc-content {
			width: 375px;
			color: rgba(153, 153, 153, 1);
			font-size: 15px;
			margin-left: 10px;

			text-overflow: -o-ellipsis-lastline;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 3;
			-webkit-box-orient: vertical;
		}
	}

	.getPhone {
		height: 49px;
		width: 355px;
		margin-left: 10px;
		background-color: purple;
		color: #fff;
		text-align: center;
		line-height: 49px;
	}
</style>
